1. Technical Field
The present invention relates generally to an improved data processing system and in particular to a method and apparatus for processing a data stream. Still more particularly, the present invention relates to a method and apparatus for processing and packetizing a data stream for improved data throughput.
2. Description of the Related Art
Multimedia, the presentation or transfer of information through more than one medium at any time, is a fast crowing segment of the computer industry with many applications being developed, which incorporate various features of multimedia. Additionally, many businesses are using multimedia to present information to consumers. Multimedia combines different forms of media in the communication of information to a user through a data processing system, such as a personal computer. A multimedia application is an application that uses different forms of communications within a single application. For example, multimedia applications may communicate data to a user through a computer via audio and video simultaneously. Such multimedia applications are usually bit intensive, real time, and very demanding, requiring ample processing power in the data processing system. Users may access in the multimedia, for example, in the form of video games or movies on a digital video disk (DVD) or through a communications link.
As our multimedia content is more increasingly residing on external devices such as network servers, and through interactive applications, there is a need for the engine processing multimedia content to not do the standard file input reads but be able to accept data from an application via buffered play. One use of buffered play is an application can either receive data from a network server and pass buffers to an engine for processing and display to the user. Another use is for an interactive application to read its own content and perform seek operations to different parts of the content based on user's actions in the application.
Interactive applications will pass buffers of the data they read from their content to the engine for processing and display to the user. For server content, an client application could receive data from a server over a network and package into buffers that can be sent to an engine for processing and display. For interactive applications, an application would create content in which different scene changes occur at exact byte positions. These scene changes would be keyed off based on user input. An interactive application can do this because content is created so seamless scene changes can occur to the user. The user has multiple possibilities of outcomes without waste of content by matching scenes to different scenes.
It is very expensive for an engine to do seeks because it must do verification and checking to assume correct positioning. If an application has control over the content, the application can do the seeks to the correct scene positions and the engine will transparently play from the new position based on the new content the application is providing. When the engine does a seek, the engine must stop the playback, seek to specified position and skip data until a position is found that contains a correct sync point for audio and video. This process puts more burden on the application but also gives it much more control over the content, especially for interactivity. When the data is passed from the application to an engine for processing, the data must be parsed into recognizable audio and video segments known as packets if using MPEG content. These audio and video packets can be passed to audio and video decoders respectively and ultimatesly to the speaker and display. Difficulty comes in when dealing with these buffers and their range in size. One problem is that the audio or video segments might span multiple buffers. It would be expensive to recopy the data into internal buffers, and is faster to use the existing buffers as placeholder until they are entirely consumed by the decoders. If the data is copied and coalesced into internal buffers, it is also difficult to manage the original buffers that match the data. Additionally, when data packets straddle buffers, difficulty occurs in processing data types in packets that cross from the end of one buffer to the beginning of the next.
Therefore, it would be desirable to have an improved method and apparatus for processing and packetizing data from a data stream to improve data throughput and provide smoothness in multimedia presentations.